Skip to content

Fixes off-by-a-half in FOVs#880

Merged
oczoske merged 7 commits intomainfrom
oc/psf_convolution
Apr 2, 2026
Merged

Fixes off-by-a-half in FOVs#880
oczoske merged 7 commits intomainfrom
oc/psf_convolution

Conversation

@oczoske
Copy link
Copy Markdown
Collaborator

@oczoske oczoske commented Feb 19, 2026

This PR

  • replaces scipy.signal.zoom with interpolation using RegularGridInterpolator and WCS in PSF rescaling
  • makes sure that the rescaled PSF kernel has odd pixel numbers on either side. This is necessary for scipy.signal.convolve with mode='same' to keep the (convolved) source centred in the output.

(The "full" convolution of an array of size nimg with a kernel of size nkern has size nimg+nkern-1. This has the same parity as nimg if nkern is odd.)

Closes #879

@oczoske oczoske self-assigned this Feb 19, 2026
@oczoske oczoske added the bugfix PR resolving one or more bugs (use "Bug" type for issues, not this label) label Feb 19, 2026
@codecov
Copy link
Copy Markdown

codecov bot commented Feb 19, 2026

Codecov Report

❌ Patch coverage is 97.05882% with 1 line in your changes missing coverage. Please review.
✅ Project coverage is 74.76%. Comparing base (67be391) to head (256434b).
⚠️ Report is 52 commits behind head on main.

Files with missing lines Patch % Lines
scopesim/effects/psfs/discrete.py 97.05% 1 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main     #880      +/-   ##
==========================================
- Coverage   74.83%   74.76%   -0.07%     
==========================================
  Files          69       69              
  Lines        8868     8936      +68     
==========================================
+ Hits         6636     6681      +45     
- Misses       2232     2255      +23     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@teutoburg teutoburg moved this to 🏗 In progress in ScopeSim-development Feb 19, 2026
@oczoske oczoske requested a review from teutoburg April 1, 2026 14:12
@oczoske oczoske marked this pull request as ready for review April 1, 2026 14:12
@oczoske oczoske changed the title Fixes off-by-a-half in FOVs; needs cleaning Fixes off-by-a-half in FOVs Apr 1, 2026
@teutoburg teutoburg moved this from 🏗 In progress to 👀 Awaiting Review in ScopeSim-development Apr 1, 2026
Copy link
Copy Markdown
Contributor

@teutoburg teutoburg left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Two minor comments, otherwise go ahead 👍

@oczoske oczoske merged commit 9a4120b into main Apr 2, 2026
25 of 26 checks passed
@oczoske oczoske deleted the oc/psf_convolution branch April 2, 2026 09:41
@github-project-automation github-project-automation bot moved this from 👀 Awaiting Review to ✅ Done in ScopeSim-development Apr 2, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bugfix PR resolving one or more bugs (use "Bug" type for issues, not this label)

Projects

Status: ✅ Done

Development

Successfully merging this pull request may close these issues.

Point source convolution with symmetric PSF yields asymmetric image

2 participants